#include <stdio.h>
#include <vector>
#include <iostream>
#include<queue>
#include<utility>
using namespace std;
class Solution {
public:
    int numIslands(vector<vector<char>>& grid) {
        int m = grid.size();
        int n = grid[0].size();
        int res = 0;
        queue<pair<int, int>> q;
        for (int i = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                if (grid[i][j] == '1') {
                    res++;
                    grid[i][j] = '0';
                    if(i+1<m){
                        if (grid[i + 1][j] == '1') {
                            grid[i + 1][j] = '0';
                            q.push(make_pair(i + 1, j));
                        }
                    }
                    if(j+1<n){
                        if (grid[i][j + 1] == '1') {
                            grid[i][j + 1] = '0';
                            q.push(make_pair(i, j + 1));
                        }
                    }
                    while (!q.empty()) {
                        int ii = q.front().first;
                        int jj = q.front().second;
                        cout << "ii=" << ii << " jj=" << jj << endl;
                        q.pop();
                        if(ii>=1){
                            if(grid[ii-1][jj]=='1'){
                                grid[ii-1][jj]='0';
                                q.push(make_pair(ii-1, jj));
                            }
                        }
                        if(jj>=1){
                            if (grid[ii][jj - 1] == '1') {
                                grid[ii][jj - 1] = '0';
                                q.push(make_pair(ii, jj - 1));
                            }
                        }
                        if(ii+1<m){
                            if (grid[ii + 1][jj] == '1') {
                                grid[ii + 1][jj] = '0';
                                q.push(make_pair(ii + 1, jj));
                            }
                        }
                        if(jj+1<n){
                            if (grid[ii][jj + 1] == '1') {
                                grid[ii][jj + 1] = '0';
                                q.push(make_pair(ii, jj + 1));
                            }
                        }
                    }
                    // for(int o=0;o<m;o++){
                    //     cout<<endl;
                    //     for(int u=0;u<n;u++){
                    //         cout<<grid[o][u]<<' ';
                    //     }
                    // }
                }
            }
        }
        return res;
    }
};
int main(){
   vector<int> a={1,2,3,4,5,6,7,8,9,10};
   a.erase(a.end()-1);
   cout<<a.size()<<endl;
   for(int i=0;i<a.size();i++){
    cout<<a[i]<<' ';
   }
    return 0;
}